<template>
  <el-input type="textarea" :rows="4" v-model="QAmodel" maxlength="500" @input="change()"></el-input>
</template>
<script>
export default {
  name: 'QPTextareaGroup',
  props: {
    rowData: {
      type: Object,
      default: () => {
        return {}
      }
    }
  },
  data() {
    return {
      QAmodel: ''
    }
  },
  mounted() {
    // 回显
    setTimeout(() => {
      if (this.rowData.answer) {
        this.QAmodel = this.rowData.answer
      }
    })
  },
  methods: {
    change() {
      let param = {
        contentId: this.rowData.id,
        titleType: this.rowData.titleType,
        answer: this.QAmodel
      }
      this.$emit('textChange', param)
    }
  }
}
</script>
